package com.medical.service.impl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.medical.mapper.HosplogininfoMapper;
import com.medical.mapper.HosplogininfoMapperCustom;
import com.medical.po.Hosplogininfo;
import com.medical.po.HosplogininfoCustom;
import com.medical.service.HosplogininfoService;

public class HosplogininfoServiceImpl implements HosplogininfoService{
	@Autowired
	private HosplogininfoMapper hosplogininfoMapper;
	@Autowired
	private HosplogininfoMapperCustom hosplogininfoMapperCustom;
	/*@Autowired
	private JdbcTemplate jdbcTemplate;*/
	@Override
	public int insertHospLogin(Hosplogininfo hosplogininfo) throws Exception {
		//新增医院端登录表一条记录
		return hosplogininfoMapper.insertSelective(hosplogininfo);
	}
	@Override
	public HosplogininfoCustom getHosplogininfo(HosplogininfoCustom hosplogininfoCustom) throws Exception{
		//登陆验证查询医院端登录表的信息，实现验证。
		return hosplogininfoMapperCustom.getHosplogininfo(hosplogininfoCustom);
	}
	@Override
	public int updateHospLogin(HosplogininfoCustom hosplogininfoCustom) throws Exception {
		// TODO Auto-generated method stub
		return hosplogininfoMapper.updateByPrimaryKeySelective(hosplogininfoCustom);
	}
	@Override
	public HosplogininfoCustom findlogininfoById(Integer id) throws Exception {
		Hosplogininfo hosplogininfo = hosplogininfoMapper.selectByPrimaryKey(id);
		HosplogininfoCustom hosplogininfoCustom = null;
		hosplogininfoCustom = new  HosplogininfoCustom();
		BeanUtils.copyProperties(hosplogininfo, hosplogininfoCustom);
		return hosplogininfoCustom;
	}
}
